package com.dnjn.happiness.system.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dnjn.happiness.common.core.web.domain.AjaxResult;
import com.dnjn.happiness.system.api.domain.SysUser;
import com.dnjn.happiness.system.domain.PositionLadder;
import com.dnjn.happiness.system.api.domain.SysTeam;
import com.dnjn.happiness.system.domain.vo.ExportTeamVO;
import com.dnjn.happiness.system.domain.vo.SysTeamVO;
import com.dnjn.happiness.system.domain.vo.TeamLineChartVO;
import com.dnjn.happiness.system.domain.vo.TeamUserSituationVO;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 人员架构Service接口
 * 
 * @author amber
 * @date 2024-01-02
 */
public interface ISysTeamService  extends IService<SysTeam>
{

    Map<String, Object> inviteCodeBind(SysTeamVO vo);

    SysTeam getTeamByUserId(Long userId);

    AjaxResult getInfoByUserId(Long userId);

    AjaxResult unBind(SysTeamVO vo);

    SysTeam queryInfoByTeamId(Long teamId);

    AjaxResult getTeamListByUserIdAndParentId(Long userId, String nickName);

    List<PositionLadder> queryPositionListByTeamId(Long teamId);

    List<SysUser> getUsersByPositionAndTeamId(Map<String, Object> map);

    Page<ExportTeamVO> getPage(ExportTeamVO vo, Page page);

    List<ExportTeamVO> getPageList(ExportTeamVO vo);

    List<ExportTeamVO> buildTreeList(HttpServletResponse response, String sheetName, List<ExportTeamVO> list);

    AjaxResult getTeamReportForms(String nickName, Long deptId);

    List<Long> recursionTeam(Long teamId);

    Integer queryRequiredCommunicateCount(Integer startInterval, Integer endInterval, int criticalValue, List<Long> longList);

    Integer queryNormalCount(Integer startInterval, Integer endInterval, int criticalValue, List<Long> longList);

    Page<TeamUserSituationVO> getGraphicReportsPage(Page page, HashMap<String, Object> map);

    BigDecimal selectYesterdayScoreAvgByUserId(Long userId);

    Integer selectDaysByUserId(Long userId);

    List<TeamLineChartVO> selectDataByWeek(String weekOfYear, Long userId);

    List<TeamLineChartVO> getWeekList();


    List<SysTeam> getSysTeamByUserId(List<SysTeam> dto);

    //得到当前登录用户下的所有团队负责人
    public List<SysTeam> getTeamList(Boolean aBoolean);

    public List<SysTeam> getEmployees(List<SysTeam> sysTeams);

    List<SysTeam> getLeaderList(List<SysTeam> listAll);

    //得到上级 和上上级别
    List<SysTeam> getManager(Long userId);

    List<SysTeam> getSubordinate(Long userId);


    SysTeam getMangerUpOne(Long userId);

    List<SysTeam> getLeaderListBydeptId(Long deptId);

    SysTeam getParentInfoByUserId(Long userId);

    List<SysTeam> getLeaderListByUserId(Long teamId);

    Long getChildCount(Long teamId);

    void updateAppraiseTime(Long userId);

    void getChildList1(Long teamId, List<SysTeam> list);

    Long selectCountByUserId(Long userId);
}
